home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / mach / ds5000.md / machConst.h < prev    next >
C/C++ Source or Header  |  1991-08-09  |  16KB  |  506 lines

  1. /*
  2.  * machConst.h --
  3.  *
  4.  *    Machine dependent constants.
  5.  *
  6.  *    Copyright (C) 1989 Digital Equipment Corporation.
  7.  *    Permission to use, copy, modify, and distribute this software and
  8.  *    its documentation for any purpose and without fee is hereby granted,
  9.  *    provided that the above copyright notice appears in all copies.
  10.  *    Digital Equipment Corporation makes no representations about the
  11.  *    suitability of this software for any purpose.  It is provided "as is"
  12.  *    without express or implied warranty.
  13.  *
  14.  * $Header: /sprite/src/kernel/mach/ds5000.md/RCS/machConst.h,v 1.6 91/08/09 15:23:36 shirriff Exp $ SPRITE (DECWRL)
  15.  */
  16.  
  17. #ifndef _MACHCONST
  18. #define _MACHCONST
  19.  
  20. #ifdef KERNEL
  21. #include "vm3maxConst.h"
  22. #else
  23. #include <kernel/vm3maxConst.h>
  24. #endif
  25.  
  26. /*
  27.  * The bits in the cause register.
  28.  *
  29.  *    MACH_CR_BR_DELAY    Exception happened in branch delay slot.
  30.  *    MACH_CR_COP_ERR        Coprocessor error.
  31.  *    MACH_CR_INT_PENDING    Which hardware interrupt is pending.
  32.  *    MACH_CR_SOFT_INT    Which software interrupt is pending.
  33.  *    MACH_CR_EXC_CODE    The exception type (see exception codes below).
  34.  */
  35. #define MACH_CR_BR_DELAY    0x80000000
  36. #define MACH_CR_COP_ERR        0x30000000
  37. #define MACH_CR_INT_PENDING    0x0000FC00
  38. #define MACH_CR_SOFT_INT    0x00000300
  39. #define MACH_CR_EXC_CODE    0x0000003C
  40. #define MACH_CR_EXC_CODE_SHIFT    2
  41.  
  42. /*
  43.  * Shift to get to the hardware interrupt bits and the number of hardware
  44.  * interrupts.
  45.  */
  46. #define MACH_CR_HARD_INT_SHIFT        10
  47. #define MACH_NUM_HARD_INTERRUPTS    6
  48.  
  49. /*
  50.  * Number of IO slots in the machine.
  51.  */
  52.  
  53. #define MACH_NUM_IO_SLOTS 8
  54.  
  55. /*
  56.  * Interrupt levels for the hardware interrupts.
  57.  *
  58.  *    MACH_IO_INTR        IO device.        
  59.  *    MACH_RTC_INTR        Real time clock.
  60.  *    MACH_RSVD1_INTR     Reserved.
  61.  *    MACH_MEM_INTR       Memory controller.
  62.  *    MACH_RSVD2_INTR     Reserved.
  63.  *    MACH_FPU_INTR        FPU.
  64.  */
  65.  
  66. #define MACH_IO_INTR        0
  67. #define MACH_RTC_INTR        1
  68. #define MACH_RSVD1_INTR     2
  69. #define MACH_MEM_INTR       3
  70. #define MACH_RSVD2_INTR     4
  71. #define MACH_FPU_INTR        5
  72.  
  73. /*
  74.  * The different exception codes.
  75.  *
  76.  *    MACH_EXC_INT        Interrupt pending.
  77.  *    MACH_EXC_TLB_MOD    TLB modified fault.
  78.  *    MACH_EXC_TLB_LD_MISS    TLB miss on load or ifetch.
  79.  *    MACH_EXC_TLB_ST_MISS    TLB miss on a store.
  80.  *    MACH_EXC_ADDR_ERR_LD    An address error on a load or ifetch.
  81.  *    MACH_EXC_ADDR_ERR_ST    An address error on a store.
  82.  *    MACH_EXC_BUS_ERR_IFETCH    A bus error on an ifetch.
  83.  *    MACH_EXC_BUS_ERR_LD_ST    A bus error on a load or store.
  84.  *    MACH_EXC_SYSCALL    A system call.
  85.  *    MACH_EXC_BREAK        A breakpoint.
  86.  *    MACH_EXC_RES_INST    A reserved instruction exception.
  87.  *    MACH_EXC_COP_UNUSABLE    Coprocessor unusable.
  88.  *    MACH_EXC_OVFLOW        Arithmetic overflow.
  89.  */
  90. #define MACH_EXC_INT        0
  91. #define MACH_EXC_TLB_MOD    1
  92. #define MACH_EXC_TLB_LD_MISS    2
  93. #define MACH_EXC_TLB_ST_MISS    3
  94. #define MACH_EXC_ADDR_ERR_LD    4
  95. #define MACH_EXC_ADDR_ERR_ST    5
  96. #define MACH_EXC_BUS_ERR_IFETCH    6
  97. #define MACH_EXC_BUS_ERR_LD_ST    7
  98. #define MACH_EXC_SYSCALL    8
  99. #define MACH_EXC_BREAK        9
  100. #define MACH_EXC_RES_INST    10
  101. #define MACH_EXC_COP_UNUSABLE    11
  102. #define MACH_EXC_OVFLOW        12
  103. #define MACH_EXC_MAX        12
  104.  
  105. /*
  106.  * The bits in the status register.  All bits are active when set to 1.
  107.  *
  108.  *    MACH_SR_CO_USABILITY    Control the usability of the four coprocessors.
  109.  *    MACH_SR_BOOT_EXC_VEC    Use alternate exception vectors.
  110.  *    MACH_SR_TLB_SHUTDOWN    TLB disabled.
  111.  *    MACH_SR_PARITY_ERR    Parity error.
  112.  *    MACH_SR_CACHE_MISS    Most recent D-cache load resulted in a miss.
  113.  *    MACH_SR_PARITY_ZERO    Zero replaces outgoing parity bits.
  114.  *    MACH_SR_SWAP_CACHES    Swap I-cache and D-cache.
  115.  *    MACH_SR_ISOL_CACHES    Isolate D-cache from main memory.
  116.  *    MACH_SR_INT_MASK    Which of the 8 interrupts are enabled.
  117.  *    MACH_SR_KU_OLD        Old kernel/user mode bit. 1 => user mode.
  118.  *    MACH_SR_INT_ENA_OLD    Old interrupt enable bit.
  119.  *    MACH_SR_KU_PREV        Previous kernel/user mode bit. 1 => user mode.
  120.  *    MACH_SR_INT_ENA_PREV    Previous interrupt enable bit.
  121.  *    MACH_SR_KU_CUR        Current kernel/user mode bit. 1 => user mode.
  122.  *    MACH_SR_INT_ENA_CUR    Current interrupt enable bit.
  123.  */
  124. #define MACH_SR_COP_USABILITY    0xf0000000
  125. #define MACH_SR_COP_0_BIT    0x10000000
  126. #define MACH_SR_COP_1_BIT    0x20000000
  127. #define MACH_SR_BOOT_EXC_VEC    0x00400000
  128. #define MACH_SR_TLB_SHUTDOWN    0x00200000
  129. #define MACH_SR_PARITY_ERR    0x00100000
  130. #define MACH_SR_CACHE_MISS    0x00080000
  131. #define MACH_SR_PARITY_ZERO    0x00040000
  132. #define MACH_SR_SWAP_CACHES    0x00020000
  133. #define MACH_SR_ISOL_CACHES    0x00010000
  134. #define MACH_SR_INT_MASK    0x0000ff00
  135. #define MACH_SR_KU_OLD        0x00000020
  136. #define MACH_SR_INT_ENA_OLD    0x00000010
  137. #define MACH_SR_KU_PREV        0x00000008
  138. #define MACH_SR_INT_ENA_PREV    0x00000004
  139. #define MACH_SR_KU_CUR        0x00000002
  140. #define MACH_SR_INT_ENA_CUR    0x00000001
  141.  
  142. /*
  143.  * The interrupt masks.  If a bit in the mask is 1 then the interrupt is
  144.  * enabled.
  145.  */
  146. #define MACH_INT_MASK_5        0x8000
  147. #define MACH_INT_MASK_4        0x4000
  148. #define MACH_INT_MASK_3        0x2000
  149. #define MACH_INT_MASK_2        0x1000
  150. #define MACH_INT_MASK_1        0x0800
  151. #define MACH_INT_MASK_0        0x0400
  152. #define MACH_KERN_INT_MASK    0xfc00
  153. #define MACH_SOFT_INT_MASK_1    0x0200
  154. #define MACH_SOFT_INT_MASK_0    0x0100
  155. #define MACH_ALL_INT_ENABLED    0xff00
  156.  
  157. /*
  158.  * The system control status register.  Comments denote whether the 
  159.  * macros are for use during a read, write, or both.
  160.  */
  161.  
  162. #define MACH_CSR_IOINT        0x000000ff    /* r   */
  163. #define MACH_CSR_LEDS        0x000000ff    /* w   */
  164. #define MACH_CSR_BAUD38        0x00000100    /* r/w */
  165. #define MACH_CSR_DIAGDN        0x00000200    /* r/w */
  166. #define MACH_CSR_BNK32M        0x00000400    /* r/w */
  167. #define MACH_CSR_TXDIS        0x00000800    /* r/w */
  168. #define MACH_CSR_LEDIAG        0x00001000    /* r/w */
  169. #define MACH_CSR_CORRECT    0x00002000    /* r/w */
  170. #define MACH_CSR_ECCMD        0x0000c000    /* r/w */
  171. #define MACH_CSR_IOINTEN    0x00ff0000    /* r/w */
  172. #define MACH_CSR_NRMMOD        0x01000000    /* r   */
  173. #define MACH_CSR_REFEVEN    0x02000000    /* r   */
  174. #define MACH_CSR_PRSVNVR    0x04000000    /* r   */
  175. #define MACH_CSR_PSWARN        0x08000000    /* r   */
  176.  
  177. #define MACH_CSR_IOINTEN_SHIFT    16
  178.  
  179.  
  180. /*
  181.  * The Error Address Status Register (ERRADR). 
  182.  * See page 26 of the functional spec.
  183.  *
  184.  *     MACH_ERRADR_ADDR    Address where error occurred.
  185.  *     MACH_ERRADR_RSRVD    Reserved.
  186.  *     MACH_ERRADR_ECCERR    Set if an ECC error occurred.
  187.  *     MACH_ERRADR_WRITE    Set if the access was a write.
  188.  *     MACH_ERRADR_CPU    Set if error was during an access by the cpu.
  189.  *     MACH_ERRADR_VALID    Set if contents are valid.
  190.  *
  191.  */
  192.  
  193. #define MACH_ERRADR_ADDRESS    0x07ffffff
  194. #define MACH_ERRADR_RSRVD    0x08000000
  195. #define MACH_ERRADR_ECCERR    0x10000000
  196. #define MACH_ERRADR_WRITE    0x20000000
  197. #define MACH_ERRADR_CPU        0x40000000
  198. #define MACH_ERRADR_VALID    0x80000000
  199.  
  200. /*
  201.  * The ECC Check/Syndrome Status Register (CHKSYN).
  202.  * See page 28 of the functional spec.
  203.  *
  204.  *    MACH_CHKSYN_SYNLO    Low bank syndrome bits.
  205.  *    MACH_CHKSYN_SNGLO    Set if single bit error.
  206.  *    MACH_CHKSYN_CHKLO    Low check bits.
  207.  *    MACH_CHKSYN_VLDLO    Set if CHKLO is valid.
  208.  *    MACH_CHKSYN_SYNHI    High bank syndrome bits.
  209.  *    MACH_CHKSYN_SNGHI    Set if single bit error.
  210.  *    MACH_CHKSYN_CHKHI    High check bits.
  211.  *    MACH_CHKSYN_VLDHI    Set if CHKHI is valid.
  212.  */                
  213.  
  214. #define MACH_CHKSYN_SYNLO    0x0000007f
  215. #define MACH_CHKSYN_SNGLO    0x00000080
  216. #define MACH_CHKSYN_CHKLO    0x00007f00
  217. #define MACH_CHKSYN_VLDLO    0x00008000
  218. #define MACH_CHKSYN_SYNHI    0x007f0000
  219. #define MACH_CHKSYN_SNGHI    0x00800000
  220. #define MACH_CHKSYN_CHKHI    0x7f000000
  221. #define MACH_CHKSYN_VLDHI    0x80000000
  222.  
  223. /*
  224.  * The bits in the context register.
  225.  */
  226. #define MACH_CNTXT_PTE_BASE    0xFFE00000
  227. #define MACH_CNTXT_BAD_VPN    0x001FFFFC
  228.  
  229. /*
  230.  * The fields in the processor revision identifier register.
  231.  */
  232. #define MACH_PRID_IMP        0x0000FF00
  233. #define MACH_PRID_REV        0x000000FF
  234.  
  235. /*
  236.  * Location of exception vectors.
  237.  */
  238. #define MACH_RESET_EXC_VEC    0xBFC00000
  239. #define MACH_UTLB_MISS_EXC_VEC    0x80000000
  240. #define MACH_GEN_EXC_VEC    0x80000080
  241.  
  242. /*
  243.  * Offsets of the fields in the Mach_State structure.
  244.  */
  245. #define    MACH_USER_PC_OFFSET        0
  246. #define MACH_TRAP_REGS_OFFSET        (MACH_USER_PC_OFFSET + 4)
  247. #define MACH_FP_REGS_OFFSET        (MACH_TRAP_REGS_OFFSET + (4 * MACH_NUM_GPRS))
  248. #define    MACH_FP_SR_OFFSET        (MACH_FP_REGS_OFFSET + (4 * MACH_NUM_FPRS))
  249. #define MACH_TRAP_MULT_LO_OFFSET    (MACH_FP_SR_OFFSET + 4)
  250. #define MACH_TRAP_MULT_HI_OFFSET    (MACH_TRAP_MULT_LO_OFFSET + 4)
  251. #define MACH_TRAP_UNIX_RET_VAL_OFFSET    (MACH_TRAP_MULT_HI_OFFSET + 4)
  252. #define    MACH_SWITCH_REGS_OFFSET        (MACH_TRAP_UNIX_RET_VAL_OFFSET + 16)
  253. #define    MACH_KERN_STACK_START_OFFSET    (MACH_SWITCH_REGS_OFFSET + (4 * MACH_NUM_GPRS) + (4 * MACH_NUM_FPRS) + 4 + 8)
  254. #define MACH_KERN_STACK_END_OFFSET    (MACH_KERN_STACK_START_OFFSET + 4)
  255. #define    MACH_SSTEP_INST_OFFSET        (MACH_KERN_STACK_END_OFFSET + 4)
  256. #define MACH_TLB_HIGH_ENTRY_OFFSET    (MACH_SSTEP_INST_OFFSET + 4)
  257.  
  258. #define MACH_TRAP_UNIX_ERRNO_OFFSET     0
  259.  
  260. /*
  261.  * Constants for setting up the TLB entries.  This code depends
  262.  * implictly upon MACH_KERN_STACK_PAGES.
  263.  */
  264. #define MACH_TLB_LOW_ENTRY_1_OFFSET    (MACH_TLB_HIGH_ENTRY_OFFSET + 4)
  265. #define MACH_TLB_LOW_ENTRY_2_OFFSET    (MACH_TLB_LOW_ENTRY_1_OFFSET + 4)
  266. #define MACH_TLB_LOW_ENTRY_3_OFFSET    (MACH_TLB_LOW_ENTRY_2_OFFSET + 4)
  267. #define MACH_STATE_SIZE            (MACH_TLB_LOW_ENTRY_3_OFFSET + 4)
  268.  
  269. /*
  270.  * Offsets into the debug state struct.
  271.  */
  272. #define MACH_DEBUG_REGS_OFFSET        0
  273. #define MACH_DEBUG_FP_REGS_OFFSET    (MACH_NUM_GPRS * 4)
  274. #define MACH_DEBUG_SIG_OFFSET        (MACH_DEBUG_FP_REGS_OFFSET + MACH_NUM_FPRS * 4)
  275. #define MACH_DEBUG_EXC_PC_OFFSET    (MACH_DEBUG_SIG_OFFSET + 32 * 4)
  276. #define MACH_DEBUG_CAUSE_REG_OFFSET    (MACH_DEBUG_EXC_PC_OFFSET + 4)
  277. #define MACH_DEBUG_MULT_HI_OFFSET    (MACH_DEBUG_CAUSE_REG_OFFSET + 4)
  278. #define MACH_DEBUG_MULT_LO_OFFSET    (MACH_DEBUG_MULT_HI_OFFSET + 4)
  279. #define MACH_DEBUG_FPC_CSR_REG_OFFSET    (MACH_DEBUG_MULT_LO_OFFSET + 4)
  280. #define MACH_DEBUG_FPC_EIR_REG_OFFSET    (MACH_DEBUG_FPC_CSR_REG_OFFSET + 4)
  281. #define MACH_DEBUG_TRAP_CAUSE_OFFSET    (MACH_DEBUG_FPC_EIR_REG_OFFSET + 4)
  282. #define MACH_DEBUG_TRAP_INFO_OFFSET    (MACH_DEBUG_TRAP_CAUSE_OFFSET + 4)
  283. #define    MACH_DEBUG_TLB_INDEX_OFFSET    (MACH_DEBUG_TRAP_INFO_OFFSET + 4)
  284. #define MACH_DEBUG_TLB_RANDOM_OFFSET    (MACH_DEBUG_TLB_INDEX_OFFSET + 4)
  285. #define MACH_DEBUG_TLB_LOW_OFFSET    (MACH_DEBUG_TLB_RANDOM_OFFSET + 4)
  286. #define MACH_DEBUG_TLB_CONTEXT_OFFSET    (MACH_DEBUG_TLB_LOW_OFFSET + 4)
  287. #define MACH_DEBUG_BAD_VADDR_OFFSET    (MACH_DEBUG_TLB_CONTEXT_OFFSET + 4)
  288. #define MACH_DEBUG_TLB_HI_OFFSET    (MACH_DEBUG_BAD_VADDR_OFFSET + 4)
  289. #define MACH_DEBUG_STATUS_REG_OFFSET    (MACH_DEBUG_TLB_HI_OFFSET + 4)
  290.  
  291. /*
  292.  * Coprocessor 0 registers:
  293.  *
  294.  *    MACH_COP_0_TLB_INDEX    TLB index.
  295.  *    MACH_COP_0_TLB_RANDOM    TLB random.
  296.  *    MACH_COP_0_TLB_LOW    TLB entry low.
  297.  *    MACH_COP_0_TLB_CONTEXT    TLB context.
  298.  *    MACH_COP_0_BAD_VADDR    Bad virtual address.
  299.  *    MACH_COP_0_TLB_HI    TLB entry high.
  300.  *    MACH_COP_0_STATUS_REG    Status register.
  301.  *    MACH_COP_0_CAUSE_REG    Exception cause register.
  302.  *    MACH_COP_0_EXC_PC    Exception PC.
  303.  *    MACH_COP_0_PRID        Processor revision identifier.
  304.  */
  305. #define MACH_COP_0_TLB_INDEX    $0
  306. #define MACH_COP_0_TLB_RANDOM    $1
  307. #define MACH_COP_0_TLB_LOW    $2
  308. #define MACH_COP_0_TLB_CONTEXT    $4
  309. #define MACH_COP_0_BAD_VADDR    $8
  310. #define MACH_COP_0_TLB_HI    $10
  311. #define MACH_COP_0_STATUS_REG    $12
  312. #define MACH_COP_0_CAUSE_REG    $13
  313. #define MACH_COP_0_EXC_PC    $14
  314. #define MACH_COP_0_PRID        $15
  315.  
  316. /*
  317.  * Return codes from Mach_Trap.
  318.  *
  319.  *   MACH_OK        The trap was handled successfully.
  320.  *   MACH_KERN_ERROR    The trap could not be handled so the debugger must be
  321.  *            called.
  322.  *   MACH_USER_ERROR    A cross address space copy to/from user space failed
  323.  *            because of a bad address.
  324.  */
  325. #define    MACH_OK            0
  326. #define    MACH_KERN_ERROR        1
  327. #define    MACH_USER_ERROR        2
  328.  
  329. /*
  330.  * Values for the code field in a break instruction.
  331.  */
  332. #define MACH_BREAK_CODE_FIELD    0x03ffffc0
  333. #define    MACH_BREAKPOINT_VAL    0
  334. #define MACH_SIG_RET_VAL    0x00010000
  335. #define MACH_SSTEP_VAL        0x00020000
  336.  
  337. /*
  338.  * Constants to differentiate between a breakpoint trap and all others.
  339.  */
  340. #define MACH_OTHER_TRAP_TYPE    0
  341. #define MACH_BRKPT_TRAP        1
  342.  
  343. /*
  344.  * MACH_KERN_START    The address where the kernel image is loaded at.
  345.  * MACH_CODE_START    The address where the kernel code is loaded at.
  346.  * MACH_STACK_BOTTOM    The address of the bottom of the kernel stack for the
  347.  *            main process that is initially run.
  348.  * MACH_KERN_END    The address where the last kernel virtual address is
  349.  *            at.
  350.  * MACH_KERN_STACK_PAGES Number of pages in a kernel stack.  This is used
  351.  *            to allocate TLB entries.  There are some
  352.  *            hard-coded dependencies on this as well, so
  353.  *            grep for MACH_KERN_STACK_PAGES in *.[cs].  The
  354.  *            last page is not mapped, so there should be
  355.  *            MACH_KERN_STACK_PAGES-1 tlb low entries, etc.
  356.  * MACH_KERN_STACK_SIZE Number of bytes in a kernel stack.
  357.  * MACH_BARE_STACK_OFFSET    Offset of where a bare kernel stack starts.
  358.  *                It doesn't start at the very top because
  359.  *                the debugger requires a couple of integers
  360.  *                of padding on the top.
  361.  * MAGIC        A magic number which is pushed onto the stack before
  362.  *            a context switch.  Used to verify that the stack
  363.  *            doesn't get trashed.
  364.  */
  365. #define    MACH_KERN_START        0x80000000
  366. #define    MACH_CODE_START        0x80030000
  367. #define    MACH_KERN_STACK_PAGES    4
  368. #define    MACH_KERN_STACK_SIZE    (MACH_KERN_STACK_PAGES * VMMACH_PAGE_SIZE)
  369. #define    MACH_STACK_BOTTOM    (MACH_CODE_START - MACH_KERN_STACK_SIZE)
  370. #define MACH_KERN_END        (VMMACH_VIRT_CACHED_START + \
  371.                     (448 + 128 + 5) * 1024 * 1024)
  372. #define    MACH_BARE_STACK_OFFSET    (MACH_KERN_STACK_SIZE - 8)
  373. #define    MAGIC            0xFeedBabe
  374.  
  375. /*
  376.  * Constants for the user's address space.
  377.  *
  378.  * MACH_FIRST_USER_ADDR        The lowest possible address in the user's VAS.
  379.  * MACH_LAST_USER_ADDR        The highest possible address in the user's VAS.
  380.  * MACH_LAST_USER_STACK_PAGE    The highest page in the user stack segment.
  381.  * MACH_MAX_USER_STACK_ADDR    The highest value that the user stack pointer
  382.  *                can have.  Note that the stack pointer must be
  383.  *                decremented before anything can be stored on
  384.  *                the stack.
  385.  */
  386. #define    MACH_FIRST_USER_ADDR        VMMACH_PAGE_SIZE
  387. #define    MACH_LAST_USER_ADDR        (MACH_MAX_USER_STACK_ADDR - 1)
  388. #define    MACH_LAST_USER_STACK_PAGE    (VMMACH_USER_MAPPING_BASE_PAGE - VMMACH_USER_SHARED_PAGES- 1)
  389. #define    MACH_MAX_USER_STACK_ADDR    (VMMACH_USER_MAPPING_BASE_ADDR - VMMACH_USER_SHARED_PAGES*VMMACH_PAGE_SIZE)
  390.  
  391. /*
  392.  * Maximum number of processors configurable.
  393.  */
  394. #define    MACH_MAX_NUM_PROCESSORS        1
  395.  
  396. /*
  397.  * The number of general purpose and floating point registers.
  398.  */
  399. #define    MACH_NUM_GPRS    32
  400. #define    MACH_NUM_FPRS    32
  401.  
  402. /*
  403.  * The indices of all of the registers in the standard 32 register array.
  404.  */
  405. #define ZERO    0
  406. #define AST    1
  407. #define V0    2
  408. #define V1    3
  409. #define A0    4
  410. #define A1    5
  411. #define A2    6
  412. #define A3    7
  413. #define T0    8
  414. #define T1    9
  415. #define T2    10
  416. #define T3    11
  417. #define T4    12
  418. #define T5    13
  419. #define T6    14
  420. #define T7    15
  421. #define S0    16
  422. #define S1    17
  423. #define S2    18
  424. #define S3    19
  425. #define S4    20
  426. #define S5    21
  427. #define S6    22
  428. #define S7    23
  429. #define T8    24
  430. #define T9    25
  431. #define K0    26
  432. #define K1    27
  433. #define GP    28
  434. #define SP    29
  435. #define S8    30
  436. #define RA    31
  437.  
  438. /*
  439.  * Magic number for system calls to differentiate between Sprite and UNIX
  440.  * system calls.
  441.  */
  442. #define MACH_SYSCALL_MAGIC    0xbab1fade
  443.  
  444. /*
  445.  * Mininum and maximum cache sizes.
  446.  */
  447. #define MACH_MIN_CACHE_SIZE    (16 * 1024)
  448. #define MACH_MAX_CACHE_SIZE    (64 * 1024)
  449.  
  450. /*
  451.  * The floating point status register.
  452.  */
  453. #define    MACH_FPC_CSR    $31
  454.  
  455. /*
  456.  * Indices in the TLB where we store the stack TLB entries.
  457.  * This is implicitly dependent on MACH_KERN_STACK_PAGES and must
  458.  * have MACH_KERN_STACK_PAGES-1 defines, used in machAsm.s.
  459.  */
  460. #define MACH_STACK_TLB_INDEX_1    0x100
  461. #define MACH_STACK_TLB_INDEX_2    0x200
  462. #define MACH_STACK_TLB_INDEX_3    0x300
  463.  
  464. /*
  465.  * The standard amount of space that we have to leave on a stack frame when
  466.  * we create it.
  467.  */
  468. #define MACH_STAND_FRAME_SIZE    24
  469.  
  470. /*
  471.  * The floating point coprocessor status register bits.
  472.  */
  473. #define MACH_FPC_ROUNDING_BITS        0x00000003
  474. #define MACH_FPC_STICKY_BITS        0x0000007c
  475. #define MACH_FPC_TRAP_ENABLE_BITS    0x00000f80
  476. #define MACH_FPC_EXCEPTION_BITS        0x0003f000
  477. #define MACH_FPC_COND_BIT        0x00800000
  478.  
  479. /*
  480.  * UNIX signal numbers to translate into Sprite signal numbers and codes.
  481.  * This is so I can steal the code for softfp.
  482.  */
  483. #define MACH_SIGFPE        1
  484. #define MACH_SIGILL        2
  485.  
  486. /*
  487.  * Constants to determine if have a floating point instruction.
  488.  */
  489. #define MACH_OPCODE_SHIFT    26
  490. #define MACH_OPCODE_C1        0x11
  491.  
  492. /*
  493.  * Special UNIX system calls.
  494.  */
  495. #define MACH_UNIX_SIG_RETURN        103
  496. #define MACH_UNIX_LONG_JUMP_RETURN    139
  497. #define MACH_MAX_UNIX_SYSCALL        171
  498.  
  499. /*
  500.  * offset of unix errno in proc control block
  501.  */
  502.  
  503. #define MACH_UNIX_ERRNO_OFFSET 696
  504.  
  505. #endif /* _MACHCONST */
  506.